fix: FTS/Vector index race condition (GitHub Issue #64)#65
Merged
Conversation
- Add isCommitConflict() helper to detect LanceDB retryable commit conflict errors - In catch block, re-verify index existence after commit-conflict before counting failure - Add jitter to retry backoff to prevent thundering-herd re-collision - Add final-pass existence check after all retries exhausted - Add unit tests for all new behaviors - Sync delta specs to main spec (openspec/specs/index-retry/spec.md) - Update backlog.md (BL-051) and roadmap.md Fixes: FTS index creation fails with transaction conflict when multiple OpenCode processes start simultaneously
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ensureIndexes()- two processes both see no index, both try to create, loser getsRetryable commit conflicterrorChanges
isCommitConflict()helper - Detects LanceDB retryable commit conflict errors ("Retryable commit conflict"or"preempted by concurrent transaction")listIndices()and adopt index as success if another process created itbaseDelay * 2^attempt + Math.random() * baseDelayto prevent thundering-herd re-collisionlistIndices()one final time before declaring failuretest/unit/index-race-condition.test.ts)Testing
npm run verify- 34 tests pass ✓Spec Sync
openspec/specs/index-retry/spec.md- 3 new requirements, 7 new scenariosDocs Updated
docs/backlog.md- Added BL-051docs/roadmap.md- Added BL-051 to P1 list